{% extends "admin/base_site_nav.html" %}
{% load i18n static admin_urls %}

{% block extrahead %}{{ block.super }}
<script src="{% url 'admin:jsi18n' %}"></script>
{% endblock %}
{% block extrastyle %}{{ block.super }}<link rel="stylesheet" href="{% static "admin/css/forms.css" %}" />{% endblock %}
{% block bodyclass %}{{ block.super }} {{ opts.app_label }}-{{ opts.model_name }} change-form{% endblock %}
{% if not is_popup %}
{% endif %}
{% block content %}<div id="content-main">
<form action="{{ form_url }}" method="post" id="{{ opts.model_name }}_form">{% csrf_token %}{% block form_top %}{% endblock %}
<div>
{% if is_popup %}<input type="hidden" name="_popup" value="1" />{% endif %}
{% if form.errors %}
    <p class="errornote">
    {% if form.errors.items|length == 1 %}{% trans "Please correct the error below." %}{% else %}
    {% trans "Please correct the errors below." %}{% endif %}
    </p>
{% endif %}
<p>{% blocktrans with username=original %}Enter a new password for the user <strong>{{ username }}</strong>.{% endblocktrans %}</p>

{% if form.password1.help_text %}
<p class="help">{% autoescape off %}{{ form.password1.help_text }}{% endautoescape %}</p>
{% endif %}
{% if form.password2.errors %}
<div class="alert alert-danger" style="max-width: 500px">{{ form.password2.errors }}</div>
{% endif %}

<fieldset class="module aligned">

<div class="form-row">
  {{ form.password1.errors }}
  {{ form.password1.label_tag }} {{ form.password1 }}
</div>

<div class="form-row">
  {% if form.password2.help_text %}
  <p class="help">{{ form.password2.help_text }}</p>
  {% endif %}
  {{ form.password2.label_tag }} {{ form.password2 }}
</div>

</fieldset>

<div>
<input class="btn btn-primary" type="submit" value="{% trans 'Change password'|capfirst %}" />
</div>

<script>document.getElementById("id_password1").focus();</script>
</div>
</form></div>
{% endblock %}
